#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>


/*
    打印命令行参数和环境表
*/
int main(int argc, char **argv)
{
    pid_t pid;

    int i;
    char **ptr;
    extern char **environ;
    
    for (i=0; i<argc; ++i)
    {
        printf("argv[%d] = %s \n", i, argv[i]);
    }

    for (ptr=environ; *ptr!=0; ptr++)
    {
        printf("%s\n", *ptr);
    }

    exit(0);
}
